package com.sy.simpleegg.serialport.coincontroller.util

import com.sy.simpleegg.serialport.coincontroller.status.MotorStatus
import com.sy.simpleegg.serialport.coincontroller.status.SnStatus


object StatusUtil {

    fun getMotorStatus(code: Int): MotorStatus {
        for (ms in MotorStatus.entries){
            if (ms.code == code){
                return ms
            }
        }
        return MotorStatus.INACTIVE
    }

    fun getSnStatus(code: Int): SnStatus {
        for (ss in SnStatus.entries){
            if (ss.code == code){
                return ss
            }
        }
        return SnStatus.SHIPPING_COMPLETED
    }

}